package top.yxf.spring;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author xs.wu
 */
public class BeanFactory {

    private final Map<String,BeanDefinition> map = new ConcurrentHashMap<>();

    public Object getBean(String name) {
        return map.get(name).getBean();
    }
    public void registerBeanDefinition(String name, BeanDefinition beanDefinition) {
        map.put(name, beanDefinition);
    }

}

